import page
from base.base import Base


class PageAxaSubmitOrder(Base):

    # 输入邮箱
    def page_input_email(self, email):
        self.base_input(page.axa_email, email)

    # 输入门牌号
    def page_input_address(self, address):
        self.base_input(page.axa_address, address)

    # 点击客户授权书
    def page_click_flag(self):
        if self.base_find(page.axa_flag):
            self.base_click(page.axa_flag)
        else:
            pass

    # 点击已阅读按钮
    def page_click_info_btn(self):
        self.base_click(page.axa_agree)

    # 点击提交订单按钮
    def page_click_next_set(self):
        self.base_click(page.axa_next_setp)

    # 输入验证码
    def page_input_validCode(self, validCode):
        self.base_input(page.axa_validCode, validCode)

    # 点击确定
    def page_click_confirm(self):
        self.base_click(page.axa_confirm)

    # 组合提交订单业务
    def page_axa_submit_order(self, email, address, validCode):
        self.page_input_email(email)
        self.page_input_address(address)
        self.page_click_flag()
        self.page_click_info_btn()
        self.page_click_next_set()
        self.page_input_validCode(validCode)
        self.page_click_confirm()